package com.huanghao.Service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.huanghao.Service.UserService;
import com.huanghao.mapper.UserMapper;
import com.huanghao.pojo.Commod;
import com.huanghao.pojo.User;

@Service
public class UserServiceimpl implements UserService{

    @Autowired
    private UserMapper userMapper;
    
    @Override
    public List<User> list(){
    	return userMapper.list();
    }

	@Override
	public void delete(Integer id) {
	userMapper.deletByid(id);
	}

	@Override
	public void add(User user) {
        userMapper.add(user);
	}

	@Override
	public void update(User user) {
		userMapper.update(user); 
		
	}

	@Override
	public User login(User user) { 
		return userMapper.getByUsernameAndPassword(user);
	}

	@Override
	public User getById(Integer id) {
        return userMapper.getById(id);
	}
	
}
